﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace HB.WpfEx
{
    public static class GraphicsEx
    {
        public static Color GetAlphacColor(this Graphics g, Color baseColor, byte alpha)
        {
            return Color.FromArgb(alpha, baseColor);
        }
        public static Pen GetAlphaPen(this Graphics g, Color baseColor, byte alpha, float width = 1)
        {
            return new Pen(g.GetAlphacColor(baseColor, alpha), width);
        }
        public static Brush GetAlphaBrush(this Graphics g, Color baseColor, byte alpha)
        {
            return new SolidBrush(g.GetAlphacColor(baseColor, alpha));
        }
    }
}
